package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserMemberMapper;
import com.ruoyi.user.domain.UserMember;
import com.ruoyi.user.service.IUserMemberService;

/**
 * 用户会员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class UserMemberServiceImpl implements IUserMemberService 
{
    @Autowired
    private UserMemberMapper userMemberMapper;

    /**
     * 查询用户会员
     * 
     * @param id 用户会员主键
     * @return 用户会员
     */
    @Override
    public UserMember selectUserMemberById(Long id)
    {
        return userMemberMapper.selectUserMemberById(id);
    }

    /**
     * 查询用户会员列表
     * 
     * @param userMember 用户会员
     * @return 用户会员
     */
    @Override
    public List<UserMember> selectUserMemberList(UserMember userMember)
    {
        return userMemberMapper.selectUserMemberList(userMember);
    }

    /**
     * 新增用户会员
     * 
     * @param userMember 用户会员
     * @return 结果
     */
    @Override
    public int insertUserMember(UserMember userMember)
    {
        userMember.setCreateTime(DateUtils.getNowDate());
        return userMemberMapper.insertUserMember(userMember);
    }

    /**
     * 修改用户会员
     * 
     * @param userMember 用户会员
     * @return 结果
     */
    @Override
    public int updateUserMember(UserMember userMember)
    {
        userMember.setUpdateTime(DateUtils.getNowDate());
        return userMemberMapper.updateUserMember(userMember);
    }

    /**
     * 批量删除用户会员
     * 
     * @param ids 需要删除的用户会员主键
     * @return 结果
     */
    @Override
    public int deleteUserMemberByIds(Long[] ids)
    {
        return userMemberMapper.deleteUserMemberByIds(ids);
    }

    /**
     * 删除用户会员信息
     * 
     * @param id 用户会员主键
     * @return 结果
     */
    @Override
    public int deleteUserMemberById(Long id)
    {
        return userMemberMapper.deleteUserMemberById(id);
    }
}
